@extends('app')

@section('content')

<link href="{{ asset('/css/spinners.css') }}" rel="stylesheet">

<div id="grid" class="grid" style="position: fixed;z-index: 1000;left:50%;display: none;">
    <div class="cell">
        <div class="card">
            <span class="throbber-loader">Loading…</span>
        </div>
    </div>
</div>

<ul class="nav nav-tabs">
    <li class="active"><a href="{{ url('/admin/users/users')}}">信息列表</a></li>
    <li><a href="{{ url('/admin/users/users/create')}}">信息编辑</a></li>
</ul>

<div class="panel panel-default mt20">

    <div class="table-responsive panel-body">
        <table class="table table-hover">
            <thead>
            <tr>
                <th>编号</th>
                <th>用户名称</th>
                <th>用户邮箱</th>
                <th>用户组</th>
                <th>用户状态</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            </thead>
            <tbody>
            @foreach($userlist as $res)
            <tr id="news_{{ $res->id }}">
                <td>{{ $res->id }}</td>
                <td><a href="{{ url('/admin/users/users/'.$res->id.'/edit') }}">{{ $res->name }} </a></td>
                <td>{{ $res->email }}</td>
                <td>{{ $res->display_name}}</td>
                <td id="disabled">
                    @if($res->is_active == 1)
                    <span class="glyphicon glyphicon-ok-circle  green-remove"
                        onclick="changeUserStatus('/admin/users/users/status','{{ $res->id }}', '{{ $res->is_active }}', '{{ csrf_token() }}')"></span>
                    @else
                    <span class="glyphicon glyphicon-remove-circle red-ok"
                          onclick="changeUserStatus('/admin/users/users/status','{{ $res->id }}', '{{ $res->is_active }}', '{{ csrf_token() }}')"></span>
                    @endif
                </td>
                <td>{{ $res->created_at }}</td>
                <td>
                    <a href="{{ url('/admin/users/users/'.$res->id.'/edit') }}"><i class="glyphicon glyphicon-edit"></i></a>&nbsp;&nbsp;&nbsp;&nbsp;
                </td>
            </tr>
            @endforeach
            </tbody>
        </table>
    </div>
    <div>{!! $userlist->render() !!} </div>
</div>
@endsection
